home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / prg_casm / snip9611.zip / ISCDROM.C < prev    next >
C/C++ Source or Header  |  1996-11-24  |  891b  |  31 lines

  1. /* +++Date last modified: 27-Oct-1996 */
  2.  
  3. /*
  4. **  Public domain by Paul Schlyter, 27-Apr-1994
  5. **
  6. **  modified for SNIPPETS by Bob Stout
  7. **
  8. **  Pass: 0 for drive A:, 1 for drive B:, 2 for drive C:, etc.
  9. **
  10. **  Returns: True_  if the drive is a CD-ROM
  11. **           False_ if the drive is not a CD-ROM
  12. **           Error_ if MSCDEX not installed
  13. */
  14.  
  15. #include "dosfiles.h"
  16.  
  17. Boolean_T isCDROMdrive(int drive)
  18. {
  19.       union REGS r;
  20.  
  21.       r.x.ax = 0x1500;              /* First test for presence of MSCDEX */
  22.       r.x.bx = 0;
  23.       int86( 0x2F, &r, &r );
  24.       if ( r.x.bx == 0 )
  25.             return Error_;          /* MSCDEX not there                  */
  26.       r.x.ax = 0x150B;              /* MSCDEX driver check API           */
  27.       r.x.cx = drive - 'A';
  28.       int86( 0x2F, &r, &r );
  29.       return  r.x.ax != 0;          /* Drive is CDROM if AX nonzero      */
  30. }
  31.